// 文本截断
@mixin text-truncate($lines: 1) {
  @if $lines == 1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  } @else {
    display: -webkit-box;
    -webkit-line-clamp: $lines;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

// 弹性布局
@mixin flex($direction: row, $justify: flex-start, $align: stretch) {
  display: flex;
  flex-direction: $direction;
  justify-content: $justify;
  align-items: $align;
}

// 响应式断点
@mixin respond-to($breakpoint) {
  @if $breakpoint == "small" {
    @media (max-width: 576px) { @content; }
  }
  @if $breakpoint == "medium" {
    @media (max-width: 768px) { @content; }
  }
  @if $breakpoint == "large" {
    @media (max-width: 992px) { @content; }
  }
  @if $breakpoint == "extra-large" {
    @media (max-width: 1200px) { @content; }
  }
}

// 阴影效果
@mixin shadow($level: 1) {
  @if $level == 1 {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  } @else if $level == 2 {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  } @else if $level == 3 {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  }
}

@mixin flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@mixin flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

// 颜色混合函数
@function color-color-mix($color1, $color2, $weight: 50%) {
  @return color-mix($color1, $color2, $weight);
}

// 亮化颜色
@function lighten-color($color, $amount: 10%) {
  @return lighten($color, $amount);
}

// 暗化颜色
@function darken-color($color, $amount: 10%) {
  @return darken($color, $amount);
} 